(function(d) {
	var a = !!(d.browser.msie && (d.browser.version == "6.0"));
	var f = 300,
	c = 150;
	function b(g) {
		var h = d.extend({},
		e, g);
		this.contrainer = d(h.contrainer)[0] || document.body;
		this.skip = h.skip;
		this.width = h.width;
		this.height = h.height;
		this.title = h.title;
		this.context = h.context;
		this.lock = h.lock;
		this.top = h.top;
		this.left = h.left;
		this.right = h.right;
		this.bottom = h.bottom;
		this.drag = h.drag;
		this.fixed = h.fixed;
		this.onOpen = h.onOpen;
		this.onClosed = h.onClosed;
		this.zoom = h.zoom;
		this.mini = h.mini;
		this._default = true;
		this._default_width = f;
		this._default_height = c;
	}
	d.extend(b.prototype, {
		onCreate: function() {
			var g = d.rand();
			if (this.lock) {
				this.pageBg = d('<div id="cover-' + g + '"></div>');
				this.pageBg.css({
					width: "100%",
					height: this.getH(),
					background: "#FFF",
					opacity: 0.6,
					position: "absolute",
					left: 0,
					top: 0,
					zIndex: 200
				});
				d(this.contrainer).append(this.pageBg);
			}
			this.boxer = document.createElement("div");
			this.boxer.className = this.skip + "-boxer";
			this.boxer.id = "dialog-" + d.rand();
			this.dialogId = this.boxer.id;
			this.coverId = "cover-" + g;
			this.contrainer.appendChild(this.boxer);
			var h = '<span class="' + this.skip + '-closed"></span>';
			if (this.zoom) {
				h += '<span class="' + this.skip + '-zoom"></span>';
			}
			if (this.mini) {
				h += '<span class="' + this.skip + '-minimize"></span>';
			}
			d(this.boxer).append('<table cellspacing="0" cellpadding="0"><tbody><tr><td><div class="' + this.skip + '-tl"></div></td><td><div class="' + this.skip + '-tc"><span class="' + this.skip + '-title">' + this.title + "</span>" + h + '</div></td><td><div class="' + this.skip + '-tr"></div></td></tr><tr><td class="' + this.skip + '-cl"></td><td><div class="' + this.skip + '-cc">' + this.context + '</div></td><td class="' + this.skip + '-cr"></td></tr><tr><td><div class="' + this.skip + '-bl"></div></td><td><div class="' + this.skip + '-bc"></div></td><td><div class="' + this.skip + '-br"></div></td></tr></tbody></table>').css({
				position: "absolute",
				width: this.width,
				height: this.height
			});
			this.setParams();
			this.addEvent();
			this.onOpen(this);
		},
		getH: function() {
			var h = document.documentElement.clientHeight || document.body.clientHeight;
			var g = document.documentElement.scrollHeight || document.body.scrollHeight;
			return (h <= g) ? g: h;
		},
		setBg: function() {
			this.pageBg.css({
				height: this.getH()
			});
		},
		setParams: function() {
			var n = d(this.boxer);
			var k = d("." + this.skip + "-tc", [this.boxer]),
			x = d("." + this.skip + "-tl", [this.boxer]),
			q = d("." + this.skip + "-tr", [this.boxer]),
			s = d("." + this.skip + "-cl", [this.boxer]),
			i = d("." + this.skip + "-cc", [this.boxer]),
			p = d("." + this.skip + "-cr", [this.boxer]),
			g = d("." + this.skip + "-bl", [this.boxer]),
			o = d("." + this.skip + "-bc", [this.boxer]),
			v = d("." + this.skip + "-br", [this.boxer]);
			var r = d(n).width(),
			m = d(n).height();
			if (!this._default) {
				r = (r <= this._default_width) ? this._default_width: r;
				m = (m <= this._default_height) ? this._default_height: m;
			}
			k.css({
				width: r - x.width() - q.width()
			});
			o.css({
				width: r - x.width() - q.width()
			});
			if (this.height != "auto") {
				i.css({
					height: m - x.height() - q.height()
				});
			}
			if (this.width != "auto") {
				i.css({
					width: r - x.width() - q.width()
				});
			}
			var u = (d(window).height() - n.height()) / 2;
			var j = (d(window).width() - n.width()) / 2;
			if (!this.fixed) {
				u += d(document).scrollTop();
				j += d(document).scrollLeft();
			}
			u = (this.top != "auto") ? this.top: u;
			j = (this.left != "auto") ? this.left: j;
			if (this.right != "auto") {
				if (this.bottom != "auto") {
					n.css({
						right: this.right,
						bottom: this.bottom
					});
				} else {
					n.css({
						right: this.right,
						top: u
					});
				}
			} else {
				if (this.bottom != "auto") {
					n.css({
						left: j,
						bottom: u
					});
				} else {
					n.css({
						left: j,
						top: u
					});
				}
			}
			n.css({
				top: u,
				left: j
			});
		},
		reSize: function() {
			var i = d(this.boxer);
			var h = (d(window).height() - i.height()) / 2;
			var g = (d(window).width() - i.width()) / 2;
			if (!this.fixed) {
				h += d(document).scrollTop();
				g += d(document).scrollLeft();
			}
			i.css({
				top: h,
				left: g
			});
			if (this.lock) {
				this.setBg();
			}
		},
		addEvent: function() {
			var j = this;
			if (this.fixed) {
				if (!a) {
					d(this.boxer).css({
						position: "fixed"
					});
				}
			}
			if (this.drag) {
				d(this.boxer).dialogDrag({
					Handle: d("." + this.skip + "-tc", [this.boxer])[0],
					Limit: true,
					mxLeft: 0,
					mxTop: 0,
					mxRight: d(document).width() - d(this.boxer).width(),
					mxBottom: d(document).height() - d(this.boxer).height()
				});
			}
			var g = d("." + this.skip + "-closed", [this.boxer]),
			h = d("." + this.skip + "-zoom", [this.boxer]),
			i = d("." + this.skip + "-minimize", [this.boxer]);
			g.bind("click",
			function() {
				j.destroy();
			}).hover(function() {
				d(this).addClass(j.skip + "-closed-over");
			},
			function() {
				d(this).removeClass(j.skip + "-closed-over");
			});
			if (this.zoom) {
				h.bind("click",
				function() {}).hover(function() {
					d(this).addClass(j.skip + "-zoom-over");
				},
				function() {
					d(this).removeClass(j.skip + "-zoom-over");
				});
			}
			if (this.mini) {
				i.bind("click",
				function() {}).hover(function() {
					d(this).addClass(j.skip + "-minimize-over");
				},
				function() {
					d(this).removeClass(j.skip + "-minimize-over");
				});
			}
			d(window).bind("resize",
			function() {
				j.reSize();
			});
		},
		destroy: function() {
			if (this.pageBg) {
				this.pageBg.remove();
			}
			d(this.boxer).remove();
			this.onClosed();
		},
		Alert: function(i, h, j) {
			this._default = false;
			this.title = "提示";
			var k = this;
			var g = i || "";
			this.context = '<div class="' + this.skip + '-alert"><div class="' + this.skip + '-txt">' + g + '</div><div class="' + this.skip + '-btnc"><input type="button" value="" class="' + this.skip + '-btn"/></div></div>';
			this.onOpen = function(l) {
				var m = d("input", [l.boxer]);
				m.get(0).focus();
				m.click(function() {
					l.destroy();
					if (h && d.isFunction(h)) {
						h();
					}
				});
				if (h && j) {
					d("." + l.skip + "-closed", [l.boxer]).bind("click",
					function() {
						h();
					});
				}
			};
			this.onCreate();
		},
		Confirm: function(i, h) {
			this._default = false;
			this.title = "";
			var g = i || "";
			this.context = '<div class="' + this.skip + '-confirm"><div class="' + this.skip + '-txt">' + g + '</div><div class="' + this.skip + '-btn"><input type="button" value="" class="' + this.skip + '-sure" /><input type="button" value="" class="' + this.skip + '-cancel" /></div>';
			this.onOpen = function(j) {
				d("." + j.skip + "-cancel", [j.boxer]).click(function() {
					j.destroy();
					if (h && d.isFunction(h)) {
						h(false);
					}
				});
				d("." + j.skip + "-sure", [j.boxer]).click(function() {
					j.destroy();
					if (h && d.isFunction(h)) {
						h(true);
					}
				});
			};
			this.onCreate();
		}
	});
	d.ns("JX.UI.Dialog");
	JX.UI.Dialog = function(g) {
		var h = new b(g);
		h.onCreate();
		return h;
	};
	d.ns("JX.UI.Alert");
	JX.UI.Alert = function(g, i, h) {
		return new b().Alert(g, i, h);
	};
	d.ns("JX.UI.Confirm");
	JX.UI.Confirm = function(g, h) {
		return new b().Confirm(g, h);
	};
	var e = {
		contrainer: null,
		width: "auto",
		height: "auto",
		left: "auto",
		right: "auto",
		top: "auto",
		bottom: "auto",
		lock: true,
		fixed: false,
		drag: true,
		title: "xxxxx.com",
		context: "HELLO,xxxx.COM!",
		onOpen: function() {},
		skip: "jx-dialog",
		onClosed: function() {},
		zoom: false,
		mini: false
	};
	d.extend({
		getMousePos: function(j) {
			if (j.pageX && j.pageY) {
				return {
					x: j.pageX,
					y: j.pageY
				};
			}
			var k = document.body.scrollLeft || document.documentElement.scrollLeft,
			g = document.body.clientLeft || document.documentElement.clientLeft,
			h = document.body.scrollTop || document.documentElement.scrollTop,
			i = document.body.clientTop || document.documentElement.clientTop;
			return {
				x: j.clientX + k - g,
				y: j.clientY + h - i
			};
		}
	});
	d.fn.dialogDrag = function(g) {
		var h = d.extend({},
		d.fn.dialogDrag.defaults, g);
		return this.each(function() {
			if (h.Lock) {
				return;
			}
			var j = d(this);
			var l = d(h.Handle || this);
			var k = false;
			if (j.css("position") != "absolute" && j.css("position") != "fixed") {
				j.css({
					position: "absolute"
				});
			}
			l.bind("mousedown",
			function(n) {
				k = true;
				if (window.captureEvents) {
					window.captureEvents(Event.MOUSEMOVE | Event.MOUSEUP);
				} else {
					if (l.get(0).setCapture) {
						l.get(0).setCapture();
					}
				}
				h._x = d.getMousePos(n).x - j.offset().left;
				h._y = d.getMousePos(n).y - j.offset().top;
				d(document).bind("mousemove", m);
				d(document).bind("mouseup", i);
				h.onStart();
			});
			function m(p) {
				if (k) {
					var o = d.getMousePos(p).x - h._x;
					var n = d.getMousePos(p).y - h._y;
					if (h.Limit) {
						o = Math.max(Math.min(o, h.mxRight), h.mxLeft);
						n = Math.max(Math.min(n, h.mxBottom), h.mxTop);
					}
					if (!h.LockX) {
						j.css({
							left: o
						});
					}
					if (!h.LockY) {
						j.css({
							top: n
						});
					}
					h.onMove();
				}
			}
			function i() {
				k = false;
				d(document).unbind("mousemove", m);
				d(document).unbind("mouseup", i);
				if (window.releaseEvents) {
					window.releaseEvents(Event.MOUSEMOVE | Event.MOUSEUP);
				} else {
					if (l.get(0).releaseCapture) {
						l.get(0).releaseCapture();
					}
				}
				h.onStop();
			}
		});
	};
	d.fn.dialogDrag.defaults = {
		Handle: null,
		Limit: false,
		mxLeft: 0,
		mxTop: 0,
		mxRight: 9999,
		mxBottom: 9999,
		_x: 0,
		_y: 0,
		Lock: false,
		LockX: false,
		LockY: false,
		onStart: function() {},
		onMove: function() {},
		onStop: function() {}
	};
})(jQuery); (function($, window) {
	$.ns("JX.UI.WaterFall");
	var WaterFall = function(options) {
		$.extend(this, {
			containerId: null,
			id: null,
			minColCount: 4,
			cubeClass: "jx_waterfall-cube",
			cubeWidth: 222,
			cubeGap: 15,
			cubeGapHeight: null,
			threshold: 0,
			fetchTime: null,
			adaptive: true,
			autoScroll: true,
			scrollLoad: true,
			autoLoad: false,
			loadingImgUrl: JX.ROOT.STATIC + "image/jiexi/loading_v3.gif",
			positionAttr: "position",
			onFetch: function() {},
			onLoaded: function() {},
			onResizeBegin: function() {},
			onResizeEnd: function() {}
		},
		options || {});
		this._col = [];
		this._width = 0;
		this._height = 0;
		this._hasFetchCount = 0;
		this._isLastTime = false;
		this._lock = false;
		this._browserLteIE8 = ($.browser.msie && parseInt($.browser.version.split(".")[0]) <= 8) ? true: false;
		this._isIE8 = ($.browser.msie && parseInt($.browser.version.split(".")[0]) == 8) ? true: false;
		this._isIE7 = ($.browser.msie && parseInt($.browser.version.split(".")[0]) == 7) ? true: false;
		this._loadingImg = null;
		this.cubeGapHeight = this.cubeGapHeight == null ? this.cubeGap: this.cubeGapHeight;
		this._init();
	};
	$.extend(WaterFall.prototype, {
		_init: function() {
			this._create();
			this._generateCol();
			this._addEvent();
			this._putCubesFromDom();
			if (this.autoLoad) {
				this._loadData();
			}
		},
		_create: function() {
			var id = this.id,
			that = this;
			if (id == null) {
				id = this.id = "jx_waterfall_" + $.rand();
				$('<div id="' + id + '" class="jx_waterfall"></div>').appendTo("#" + this.containerId);
			} else {
				$("#" + id).addClass("jx_waterfall");
			}
			var loading = new Image();
			loading.src = this.loadingImgUrl;
			loading.onload = function() {
				that._loadingImg = $(loading).css({
					position: "absolute",
					left: "50%",
					marginLeft: -loading.width,
					bottom: -(loading.height + 10),
					display: "none"
				});
				$("#" + id).append(loading);
			};
		},
		_generateCol: function() {
			var clientWidth = $($("#" + this.id)[0].parentNode).width(),
			col = [],
			colNum = 0,
			minColCount = this.minColCount,
			cubeWidth = this.cubeWidth,
			cubeGap = this.cubeGap,
			intColNum = 0,
			duration = 0,
			ret = 0;
			colNum = clientWidth / cubeWidth;
			intColNum = parseInt(colNum);
			duration = (colNum - intColNum) * cubeWidth;
			if (duration >= (intColNum - 1) * cubeGap) {
				ret = intColNum;
			} else {
				ret = intColNum - 1;
			}
			ret = ret < minColCount ? minColCount: ret;
			for (var i = 0; i < ret; i++) {
				var o = {
					id: i + 1,
					left: i * (cubeWidth + cubeGap),
					height: 0,
					count: 0
				};
				col.push(o);
			}
			this._width = ret * cubeWidth + (ret - 1) * cubeGap;
			$("#" + this.id).css({
				width: this._width
			});
			this._col = col;
		},
		_put: function(cube) {
			var lowwestCol = this._getLowwestCol(),
			gap = lowwestCol.height == 0 ? 0: this.cubeGapHeight,
			waterfall = $("#" + this.id),
			ifLteIE8 = this._browserLteIE8,
			isStringCube = false;
			var that = this;
			if (typeof cube == "string") {
				cube = $(cube);
				if (!ifLteIE8) {
					cube.hide();
				}
				isStringCube = true;
			}
			var positionAttr = cube.attr(this.positionAttr);
			if (positionAttr !== undefined && $.trim(positionAttr) != "") {
				that._insertBefore(cube, positionAttr);
				if (!ifLteIE8) {
					cube.fadeIn(1000);
				}
				return;
			}
			var cubeId = this.id + "_" + lowwestCol.id + "_" + parseInt(lowwestCol.count + 1);
			lowwestCol.count += 1;
			cube.css({
				left: lowwestCol.left,
				top: lowwestCol.height + gap
			});
			if (this._isIE8) {
				cube.attr("cubeId", cubeId);
			} else {
				cube.attr("id", cubeId);
			}
			if (isStringCube) {
				waterfall.append(cube);
			}
			lowwestCol.height += cube.height() + gap;
			if (lowwestCol.height > this._height) {
				this._height = lowwestCol.height;
			}
			if (!ifLteIE8) {
				cube.fadeIn(1000);
			}
		},
		_putAll: function(cubes, isLastTime) {
			var that = this,
			waterfall = $("#" + this.id);
			$.each(cubes,
			function(i, v) {
				that._put(v);
			});
			waterfall.css({
				height: this._height
			});
			if (isLastTime !== undefined) {
				this._isLastTime = isLastTime;
			}
			this._hasFetchCount++;
			this._isFinish();
			this._lock = false;
			waterfall.css({
				visibility: "visible"
			});
			if (this._loadingImg) {
				this._loadingImg.hide();
			}
			that.onLoaded(that._hasFetchCount, that._isLastTime);
		},
		pushBack: function(params) {
			var ifIE8 = this._isIE8,
			ifIE7 = this._isIE7;
			if (params.ifInsertBefore) {
				params.ifMoveCurrent = true;
			}
			var cubeInfoArray = params.cubeId.split("_"),
			colId = cubeInfoArray[1],
			colIndex = colId - 1 < 0 ? 0: colId - 1,
			cubeIndex = parseInt(cubeInfoArray[2]),
			currentCol = this._col[colIndex],
			waterfall = $("#" + this.id),
			startIndex = params.ifMoveCurrent ? cubeIndex: cubeIndex + 1;
			for (var i = currentCol.count; i >= startIndex; i--) {
				var nextCubeId = cubeInfoArray[0] + "_" + colId + "_" + i;
				var nextCube = $("#" + nextCubeId);
				if (ifIE8) {
					nextCube = $("#" + this.id).find("[cubeId=" + nextCubeId + "]");
				}
				var oriTop = parseInt(nextCube.css("top"));
				nextCube.css({
					top: oriTop + params.changeValue
				});
				if (params.ifInsertBefore) {
					nextCube.attr("id", cubeInfoArray[0] + "_" + colId + "_" + (i + 1));
				}
			}
			currentCol.height += params.changeValue;
			if (currentCol.height > this._height) {
				this._height = currentCol.height;
				waterfall.css({
					height: currentCol.height
				});
			}
		},
		_insertBefore: function(cube, posStr) {
			var posArray = posStr.split("_"),
			colArray = this._col,
			colIndex = 0,
			colCount = colArray.length,
			ifLteIE8 = this._browserLteIE8,
			ifIE8 = this._isIE8,
			ifIE7 = this._isIE7;
			var targetId = "";
			if (parseInt(posArray[0]) <= colCount - 1) {
				targetId = this.id + "_" + (colCount - parseInt(posArray[0])) + "_" + (parseInt(posArray[1]) + 1);
				colIndex = colCount - parseInt(posArray[0]) - 1;
			} else {
				targetId = this.id + "_1_" + (parseInt(posArray[1]) + 1);
				colIndex = 0;
			}
			var currentCol = colArray[colIndex],
			gap = currentCol.height == 0 ? 0: this.cubeGapHeight;
			if (ifIE8) {
				if (targetId == cube.attr("cubeId")) {
					return;
				}
			} else {
				if (targetId == cube.attr("id")) {
					return;
				}
			}
			var targetCube = $("#" + targetId);
			if (ifIE8) {
				targetCube = $("#" + this.id).find("[cubeId=" + targetId + "]");
			}
			if (targetCube.size() > 0) {
				var oriTop = targetCube.css("top");
				this.pushBack({
					cubeId: targetId,
					changeValue: cube.outerHeight() + gap,
					ifMoveCurrent: true,
					ifInsertBefore: true
				});
				cube.insertBefore(targetCube);
				cube.css({
					left: targetCube.css("left"),
					top: oriTop
				});
				if (ifIE8) {
					cube.attr("cubeId", targetId);
				} else {
					cube.attr("id", targetId);
				}
				colArray[colIndex].count += 1;
			} else {
				var cubeId = this.id + "_" + currentCol.id + "_" + parseInt(currentCol.count + 1);
				if (ifIE8) {
					cube.attr("cubeId", cubeId);
				} else {
					cube.attr("id", cubeId);
				}
				cube.css({
					left: currentCol.left,
					top: currentCol.height + gap
				});
				currentCol.height += cube.height() + gap;
				if (currentCol.height > this._height) {
					this._height = currentCol.height;
				}
				currentCol.count += 1;
			}
		},
		insertBefore: function(cube, posStr) {
			cube.attr(this.positionAttr, posStr, true);
			cube.appendTo($("#" + this.id));
			this._put(cube);
		},
		_isFinish: function() {
			var isLastTime = this._isLastTime,
			fetchTime = this.fetchTime;
			if (!isLastTime) {
				if (fetchTime != null) {
					if (this._hasFetchCount >= fetchTime) {
						this._isLastTime = true;
					} else {
						this._isLastTime = false;
					}
				} else {
					this._isLastTime = false;
				}
			}
			return this._isLastTime;
		},
		_getLowwestCol: function() {
			var heightArray = [],
			col = this._col;
			for (var i = 0; i < col.length; i++) {
				heightArray.push(col[i].height);
			}
			var minHeight = heightArray.min();
			this._height = heightArray.max();
			for (var j = 0; j < col.length; j++) {
				if (col[j].height == minHeight) {
					return col[j];
				}
			}
		},
		_addEvent: function() {
			var that = this,
			waterFall = $("#" + this.id);
			if (this.adaptive) {
				$(window).bind("resize",
				function() {
					clearTimeout(that.timerId);
					that.timerId = setTimeout(function() {
						that.onResizeBegin();
						that._generateCol();
						waterFall.css({
							width: that._width
						});
						that._putCubesFromDom(true);
						that.onResizeEnd();
					},
					300);
				});
			}
			if (this.scrollLoad && this.autoScroll) {
				var doc = $(document);
				$(window).bind("scroll",
				function() {
					if (!that._isLastTime && !that._lock) {
						var clientHeight = document.documentElement.clientHeight || document.body.clientHeight;
						var remainder = waterFall.height() - (doc.scrollTop() - waterFall.offset().top + clientHeight);
						if (remainder < that.threshold) {
							that._loadData();
						}
					}
				});
			}
		},
		_loadData: function() {
			this._lock = true;
			this.onFetch(this._changeContext(this, this._putAll), this._hasFetchCount + 1);
			if (this._loadingImg) {
				this._loadingImg.show();
			}
		},
		_changeContext: function(context, fn) {
			return function() {
				fn.apply(context, arguments);
			};
		},
		_putCubesFromDom: function(isResize) {
			var that = this,
			ifIE8 = this._isIE8,
			ifIE7 = this._isIE7;
			var waterFall = $("#" + this.id),
			cubes = $("#" + this.id + " ." + this.cubeClass);
			if (ifIE8) {
				cubes.removeAttr("cubeId");
			} else {
				cubes.removeAttr("id");
			}
			cubes.each(function() {
				that._put($(this));
			});
			waterFall.css({
				height: this._height
			});
			if (!isResize) {
				waterFall.css({
					visibility: "visible"
				});
				that.onLoaded(0, null);
			}
		},
		_isScroll: function(el) {
			var elems = el ? [el] : [document.documentElement, document.body];
			var scrollX = false,
			scrollY = false;
			for (var i = 0; i < elems.length; i++) {
				var o = elems[i];
				var sl = o.scrollLeft;
				o.scrollLeft += (sl > 0) ? -1: 1;
				o.scrollLeft !== sl && (scrollX = scrollX || true);
				o.scrollLeft = sl;
				var st = o.scrollTop;
				o.scrollTop += (st > 0) ? -1: 1;
				o.scrollTop !== st && (scrollY = scrollY || true);
				o.scrollTop = st;
			}
			return {
				scrollX: scrollX,
				scrollY: scrollY
			};
		},
		putFromLocalData: function(cubes, isLastTime) {
			this._lock = true;
			this._putAll(cubes, isLastTime);
		},
		reput: function() {
			var waterFall = $("#" + this.id);
			this._generateCol();
			waterFall.css({
				width: this._width
			});
			this._putCubesFromDom(true);
		},
		clear: function() {
			$("#" + this.id + " ." + this.cubeClass).remove();
			this._generateCol();
			this._height = 0;
			this._hasFetchCount = 0;
			this._isLastTime = false;
			this._lock = false;
		},
		transData: function(returnText) {
			var data = {
				cubes: null,
				isLastRequest: false,
				lastId: null
			},
			cubes = [];
			var ret = returnText.replace(/isLastRequest\s*=\s*(true|false)/i,
			function(a, b) {
				data.isLastRequest = $.eval(b);
				return "";
			});
			ret = returnText.replace(/lastId\s*=\s*(\d+)/i,
			function(a, b) {
				data.lastId = b;
				return "";
			});
			$(ret).each(function() {
				if (this.nodeType == 1) {
					cubes.push(this.outerHTML);
				}
			});
			data.cubes = cubes;
			return data;
		}
	});
	JX.UI.WaterFall = function(options) {
		return new WaterFall(options);
	};
})(jQuery, window); (function(b) {
	var c = {
		skin: "jx-datepicker",
		contrainer: null,
		inputObj: null,
		model: 1,
		ymd: "",
		name: "jxdatepicker",
		HH: 250,
		floats: false,
		enabled: true,
		callback: function() {}
	};
	function a(e) {
		var g = b.extend({},
		c, e);
		for (var d in g) {
			this[d] = g[d];
		}
		this.contrainer = (this.contrainer == null) ? b(document.body) : this.contrainer;
		this.reg = /^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31)|(((0[1,3-9])|(1[0-2]))-(29|30)))))$/;
		this.monthName = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一", "十二"];
		var f = !!(b.trim(this.ymd) != "" && this.reg.test(this.ymd));
		var h = f ? this.splitDate(this.ymd, "-") : this.getToday();
		this.yy = h.yy;
		this.mm = h.mm;
		this.dd = h.dd;
		if (this.model == 1 && this.inputObj != null && this.inputObj.attr("value") != "" && this.reg.test(this.inputObj.attr("value"))) {
			this.setValue();
		}
		this.init();
	}
	a.prototype = {
		init: function() {
			var d = this;
			if (this.model == 1) {
				this.inputObj.bind("click",
				function() {
					if (d.enabled) {
						if (b(this).data("datepicker") && b("#" + d.name + b(this).data("datepicker"))) {
							var e = b("#" + d.name + b(this).data("datepicker"));
							if (e.css("display") == "none") {
								d.setValue();
								d.updatePanel();
								e.css("display", "block");
								d.setPos();
							}
						} else {
							var f = new Date().getTime();
							b(this).data("datepicker", f);
							d.onCreate(f);
						}
					}
				});
			}
		},
		setValue: function() {
			if (this.inputObj.attr("value") && this.inputObj.attr("value") != "") {
				var d = this.splitDate(this.inputObj.attr("value"), "-");
				this.yy = d.yy;
				this.mm = d.mm;
				this.dd = d.dd;
			}
		},
		onCreate: function(g) {
			this.panel = b("<div></div>");
			if (typeof g != "undefined") {
				this.panel.attr("id", this.name + g);
			}
			this.panel.addClass(this.skin);
			this.panel.addClass(this.skin + "-" + this.model);
			this.header = b("<div></div>");
			this.header.addClass("jdp-header");
			var e = (this.mm <= 9) ? ("0" + this.mm) : this.mm;
			var f = (this.dd <= 9) ? ("0" + this.dd) : this.dd;
			if (this.model == 1) {
				this.header.html('<span class="jdp-month-prev"></span><cite class="jdp-ym-txt jdp-has-opt">' + this.yy + "年" + e + '月</cite><span class="jdp-month-next"></span>');
			} else {
				this.header.html('<cite class="jdp-ym-txt jdp-ym-noopt">' + this.yy + "年" + e + "月</cite>");
			}
			this.bodyer = b("<div></div>");
			this.bodyer.addClass("jdp-bodyer");
			this.panel.append(this.header).append(this.bodyer);
			if (this.model == 1) {
				this.footer = b("<div></div>");
				this.footer.addClass("jdp-footer");
				this.ymer = b("<div></div>");
				this.ymer.addClass("jdp-ym");
				this.ymer.data({
					yy: this.yy,
					mm: this.mm
				});
				this.footer.html("今天：" + this.yy + "年" + e + "月" + f + "日");
				this.panel.append(this.footer).append(this.ymer);
				this.ymer.html(this.drawMY());
				this.ymer.data("nowy", this.yy);
				this.ymH = this.ymer.height();
			}
			this.bodyer.html(this.drawD(this.yy, this.mm, this.dd));
			this.contrainer.append(this.panel);
			if (this.model == 1) {
				this.setPos();
			}
			this.addEvent();
		},
		setPos: function() {
			var j = document.documentElement.clientHeight || document.body.clientHeight;
			var f = document.documentElement.scrollTop || document.body.scrollTop;
			var d = this.inputObj.offset().left;
			var e = this.inputObj.offset().top;
			if (this.floats) {
				d = this.inputObj.position().left;
				e = this.inputObj.position().top;
			}
			var i = this.inputObj.height();
			var k = this.panel.height();
			var g = (j - e - i + f < k) ? (e - k - 5) : (e + i);
			this.panel.css({
				top: g,
				left: d
			});
		},
		getToday: function() {
			var d = new Date();
			return {
				yy: d.getFullYear(),
				mm: d.getMonth() + 1,
				dd: d.getDate()
			};
		},
		splitDate: function(e, f) {
			var d = e.split(f);
			return {
				yy: d[0],
				mm: parseInt(d[1], 10),
				dd: parseInt(d[2], 10)
			};
		},
		updatePanel: function() {
			var d = (this.mm <= 9) ? ("0" + this.mm) : this.mm;
			this.header.find(".jdp-ym-txt").html(this.yy + "年" + d + "月");
			this.bodyer.html(this.drawD(this.yy, this.mm, this.dd));
			this.markD();
		},
		addEvent: function() {
			var e = this;
			var d = this.header.find("cite");
			if (this.model == 1) {
				d.bind("click",
				function() {
					e.showYM();
					e.markM();
					e.setY(e.yy);
				}).bind("mouseover",
				function() {
					b(this).addClass("jdp-has-opt-over");
				}).bind("mouseout",
				function() {
					b(this).removeClass("jdp-has-opt-over");
				});
				this.ymer.find("input.jdp-sure").bind("click",
				function() {
					e.yy = e.ymer.data("nowy");
					e.mm = e.ymer.data("mm");
					e.updatePanel();
					e.hideYM();
				});
				this.ymer.find("input.jdp-cancel").bind("click",
				function() {
					e.hideYM();
				});
				this.ymer.find("input.prev-year").bind("click",
				function() {
					var f = parseInt(e.ymer.data("yy"));
					e.ymer.data("yy", f - 12);
					e.setY(e.ymer.data("yy"));
				});
				this.ymer.find("input.next-year").bind("click",
				function() {
					var f = parseInt(e.ymer.data("yy"));
					e.ymer.data("yy", f + 12);
					e.setY(e.ymer.data("yy"));
				});
				this.ymer.find(".jdp-m td").each(function(f) {
					b(this).bind("click",
					function() {
						e.ymer.find(".jdp-m td.on").removeClass("on");
						e.ymer.data("mm", f + 1);
						b(this).addClass("on");
					});
				});
				b(document).bind("click",
				function(g) {
					var f = g.srcElement || g.target;
					if (f != e.inputObj[0] && !b(f).parents("." + e.skin)[0]) {
						e.hidePanel();
					}
				});
			}
			if (this.model != 3) {
				this.header.find("span.jdp-month-prev").bind("click",
				function() {
					e.prevMonth();
					var f = (e.mm <= 9) ? ("0" + e.mm) : e.mm;
					d.html(e.yy + "年" + f + "月");
					e.bodyer.html(e.drawD(e.yy, e.mm, e.dd));
					e.markD();
				}).bind("mouseover",
				function() {
					b(this).addClass("jdp-month-prev-over");
				}).bind("mouseout",
				function() {
					b(this).removeClass("jdp-month-prev-over");
				});
				this.header.find("span.jdp-month-next").bind("click",
				function() {
					e.nextMonth();
					var f = (e.mm <= 9) ? ("0" + e.mm) : e.mm;
					d.html(e.yy + "年" + f + "月");
					e.bodyer.html(e.drawD(e.yy, e.mm, e.dd));
					e.markD();
				}).bind("mouseover",
				function() {
					b(this).addClass("jdp-month-next-over");
				}).bind("mouseout",
				function() {
					b(this).removeClass("jdp-month-next-over");
				});
			}
			if (this.model == 1 || this.model == 2) {
				this.markD();
			}
			if (this.model == 3) {
				this.callback(this.bodyer);
			}
		},
		markD: function() {
			var d = this;
			this.bodyer.find("td a").each(function() {
				var e = b(this);
				if (e.attr("month") && e.attr("year")) {
					if (e.attr("month") == d.mm && e.attr("year") == d.yy && e.html() == d.dd) {
						e.addClass("on");
					}
					e.bind("click",
					function() {
						var h = parseInt(b(this).attr("year"));
						var g = parseInt(b(this).attr("month"), 10);
						var f = parseInt(b(this).html(), 10);
						d.yy = h;
						d.mm = g;
						d.dd = f;
						if (g <= 9) {
							g = "0" + g;
						}
						if (f <= 9) {
							f = "0" + f;
						}
						d.inputObj.attr("value", h + "-" + g + "-" + f);
						d.hidePanel();
						d.callback(e.attr("year"), e.attr("month"), e.html());
					});
				}
			});
		},
		markM: function() {
			this.ymer.find(".jdp-m td.on").removeClass("on");
			this.ymer.find(".jdp-m td").eq(this.mm - 1).addClass("on");
		},
		setY: function(e) {
			var d = this;
			this.ymer.find(".jdp-y tbody").html(this.drawY(e));
			this.ymer.find(".jdp-y td").bind("click",
			function() {
				d.ymer.find(".jdp-y td.on").removeClass("on");
				d.ymer.data("yy", parseInt(b(this).html()));
				d.ymer.data("nowy", parseInt(b(this).html()));
				b(this).addClass("on");
			});
		},
		showYM: function() {
			this.ymer.animate({
				top: 0
			},
			"slow");
		},
		hideYM: function() {
			this.ymer.animate({
				top: -this.HH
			},
			"slow");
		},
		showPanel: function() {
			this.panel.css({
				display: "block"
			});
		},
		hidePanel: function() {
			this.panel.css({
				display: "none"
			});
			this.ymer.css({
				top: -this.HH
			});
		},
		prevMonth: function() {
			if (this.mm == 1) {
				this.mm = 12;
				this.yy = parseInt(this.yy) - 1;
			} else {
				this.mm -= 1;
			}
		},
		nextMonth: function() {
			if (this.mm == 12) {
				this.mm = 1;
				this.yy = parseInt(this.yy) + 1;
			} else {
				this.mm += 1;
			}
		},
		drawMY: function() {
			var e = '<div class="jdm-h"><span>月份</span><span>年份</span><input type="button" value="" class="prev-year"/><input type="button" value="" class="next-year"/></div>';
			e += '<div class="jdp-m"><table cellpadding="0" cellspacing="0" width="100%">';
			for (var d = 0; d < this.monthName.length / 2; d++) {
				e += "<tr><td>" + this.monthName[d * 2] + "</td><td>" + this.monthName[d * 2 + 1] + "</td></tr>";
			}
			e += "</table></div>";
			e += '<div class="jdp-y"><table cellpadding="0" cellspacing="0" width="100%"><tbody>' + this.drawY(this.yy) + "</tbody></table></div>";
			e += '<div class="jdp-f"><input type="button" value="" class="jdp-sure"/> <input type="button" value="" class="jdp-cancel"/></div>';
			return e;
		},
		drawY: function(f) {
			var e = "";
			for (var d = 0; d < 6; d++) {
				if (d == 2 && f == this.yy) {
					e += "<tr><td>" + (f - (5 - d * 2)) + '</td><td class="on">' + (f - (5 - d * 2 - 1)) + "</td></tr>";
				} else {
					e += "<tr><td>" + (f - (5 - d * 2)) + "</td><td>" + (f - (5 - d * 2 - 1)) + "</td></tr>";
				}
			}
			return e;
		},
		drawD: function(l, u, y) {
			var d = this.coutDays(l, u);
			var w = this.weekPos(l, u, 1);
			var o = '<div class="jdp-b-t"><table cellpadding="0" cellspacing="0" width="100%"><tr><td>日</td><td>一</td><td>二</td><td>三</td><td>四</td><td>五</td><td>六</td></tr></table></div><div class="jdp-b-c"><table cellpadding="0" cellspacing="0" width="100%">';
			var q = (u == 1) ? 12: (u - 1),
			k = (u == 1) ? (l - 1) : l,
			x = this.coutDays(k, q);
			var n = (u == 12) ? 1: (u + 1),
			h = (u == 12) ? (parseInt(l) + 1) : l,
			r = this.coutDays(h, n);
			o += "<tr>";
			for (var t = w; t > 0; t--) {
				o += '<td class="jdp-no"><a year="' + k + '" month="' + q + '">' + (x - t + 1) + "</a></td>";
			}
			for (var t = 0; t < 7 - w; t++) {
				o += '<td><a year="' + l + '" month="' + u + '">' + (t + 1) + "</a></td>";
			}
			o += "</tr>";
			var p = 7 - w;
			for (var e = 0; e < 3; e++) {
				o + "<tr>";
				for (var t = p; t < 7 + p; t++) {
					o += '<td><a  year="' + l + '" month="' + u + '">' + (t + 1) + "</a></td>";
				}
				p += 7;
				o += "</tr>";
			}
			var v = d - (7 - w) - 21;
			if (v < 7) {
				var j = (7 - w) + 21;
				o += "<tr>";
				for (var t = j; t < d; t++) {
					o += '<td><a  year="' + l + '" month="' + u + '">' + (t + 1) + "</a></td>";
				}
				for (var t = 0; t < 7 - (d - j); t++) {
					o += '<td class="jdp-no"><a year="' + h + '" month="' + n + '">' + (t + 1) + "</a></td>";
				}
				o += "</tr><tr>";
				var g = 7 - (d - j);
				for (var t = g; t < 7 + g; t++) {
					o += '<td class="jdp-no"><a year="' + h + '" month="' + n + '">' + (t + 1) + "</a></td>";
				}
				o += "</tr>";
			} else {
				var j = (7 - w) + 21;
				o += "<tr>";
				for (var t = j; t < 7 + j; t++) {
					o += '<td><a  year="' + l + '" month="' + u + '">' + (t + 1) + "</a></td>";
				}
				o += "</tr><tr>";
				var g = d - (j + 7);
				for (var t = j + 7; t < d; t++) {
					o += '<td><a  year="' + l + '" month="' + u + '">' + (t + 1) + "</a></td>";
				}
				for (var t = 0; t < 7 - g; t++) {
					o += '<td class="jdp-no"><a year="' + h + '" month="' + n + '">' + (t + 1) + "</a></td>";
				}
				o += "</tr></table></div>";
			}
			return o;
		},
		coutDays: function(d, e) {
			if (e == 1 || e == 3 || e == 5 || e == 7 || e == 8 || e == 10 || e == 12) {
				return 31;
			}
			if (e == 4 || e == 6 || e == 9 || e == 11) {
				return 30;
			}
			if (e == 2 && this.isLeapyear(d)) {
				return 29;
			}
			return 28;
		},
		weekPos: function(e, f, d) {
			return (new Date(e, f - 1, d)).getDay();
		},
		isLeapyear: function(d) {
			if ((d % 4 == 0) || ((d % 4 == 0) && (d % 100 == 0))) {
				return true;
			}
			return false;
		}
	};
	b.ns("JX.UI.Datepicker");
	JX.UI.Datepicker = function(d) {
		return new a(d);
	};
})(jQuery); (function(b) {
	var a = {
		hasScore: true,
		typer: 0,
		Ele_score: null,
		Ele_textarea: null,
		Ele_paging: null,
		Ele_content: null,
		Ele_button: null,
		Ele_tips: null,
		Ele_title: null,
		Ele_url: null,
		Ele_sum: null,
		tips: "发表你的评论...",
		Ele_login: null,
		sub_url: null,
		data_url: null,
		login_url: "http://www.jiexi.com/user/login",
		starNum: 8,
		fontNum: 240,
		isLogin: (JX.init && JX.init.userId && JX.init.userId != "" && JX.init.userId != "-1") ? true: false,
		total: 10,
		comH: 100,
		zc_tips: ""
	};
	var c = function(e) {
		var f = b.extend({},
		a, e);
		for (var d in f) {
			this[d] = f[d];
		}
		this.error = 0;
		this.totalNum = 0;
		this.currentNum = 1;
		this.pageUrl = location.href;
		if (this.pageUrl.indexOf("#") != -1) {
			this.pageUrl = this.pageUrl.split("#")[0];
		}
		if (this.typer == 0) {
			this.pageUrl += "#Comment";
		} else {
			this.pageUrl += "#Ask";
		}
		this.canRequest = true;
	};
	c.prototype = {
		init: function() {
			this.onCreate();
			this.addEvent();
		},
		onCreate: function() {
			if (this.typer == 0) {
				var f = '<span>打分：</span><a class="on"></a><a class="on"></a><a class="on"></a><a class="on"></a><a></a><input type="hidden" value="' + this.starNum + '" /><span class="score_tips" style="display:none;">*打分不能为空</span>';
				this.Ele_score.html(f);
				this.scoreA = this.Ele_score.find("a");
				this.scoreV = this.Ele_score.find("input");
			}
			var h = (this.typer == 0) ? "コメント": "お問合わせ";
			h = (this.zc_tips != "") ? this.zc_tips: h;
			var i = '<span class="comment_null_tip" style="display:none;">*' + h + '不能为空。</span><span class="comment_limit_tip">入力可能：<cite>' + this.fontNum + '</cite>文字</span><span class="comment_over_tip" style="display:none;">入力可能な文字数を超えています（<cite>0</cite>）</span>';
			this.Ele_tips.html(i);
			var g = this.Ele_tips.find("span"),
			e = this.Ele_tips.find("cite");
			this.tips_null = g.eq(0);
			this.tips_limit = g.eq(1);
			this.tips_over = g.eq(2);
			this.limit_cout = e.eq(0);
			this.over_cout = e.eq(1);
			var d = '<div><label>用户名：</label><input type="text" name="userName" class="comment_txt"/><cite style="display:none;">*用户名不能为空。</cite></div><div><label>密　码：</label><input type="password" name="userPwd" class="comment_txt"/><cite style="display:none;">*密码不能为空。</cite></div><div class="login-opt"><a href="/user/findpwd" target="_blank">忘记密码？</a> 不是会员，请<a href="/user/register?originUrl=' + this.pageUrl + '">注册</b></div>';
			if (!this.isLogin) {
				this.Ele_login.html(d);
				this.user_name = this.Ele_login.find("input").eq(0);
				this.user_pwd = this.Ele_login.find("input").eq(1);
				this.name_tips = this.Ele_login.find("cite").eq(0);
				this.pwd_tips = this.Ele_login.find("cite").eq(1);
			}
		},
		skipTo: function(g) {
			var f = document.documentElement.clientHeight || document.body.clientHeight;
			var e = document.documentElement.scrollHeight || document.body.scrollHeight;
			if (f < e) {
				var d = (window.opera) ? (document.compatMode == "CSS1Compat" ? b("html") : b("body")) : b("html,body");
				d.animate({
					scrollTop: g
				},
				200);
			}
		},
		addEvent: function() {
			var d = this;
			if (this.typer == 0) {
				this.scoreA.each(function(e) {
					b(this).bind("click",
					function() {
						d.setScore(e);
					});
				});
			}
			this.Ele_textarea.bind("keyup",
			function() {
				d.checkComment();
			}).bind("blur",
			function() {
				if (b.trim(this.value) == "") {
					this.value = d.tips;
					this.style.color = "#CCC";
				} else {
					d.checkComment();
				}
			}).bind("focus",
			function() {
				if (b.trim(this.value) == d.tips) {
					this.value = "";
					this.style.color = "#000";
				}
				if (d.tips_null.css("display") != "none") {
					d.tips_null.css("display", "none");
					d.tips_limit.css("display", "block");
				}
				if (!d.isLogin) {
					d.iFlogin();
				}
			});
			this.Ele_button.bind("click",
			function() {
				if (b.trim(d.Ele_textarea.val()) == "" || b.trim(d.Ele_textarea.val()) == d.tips) {
					if (d.tips_null.css("display") == "none") {
						d.tips_null.css("display", "");
						d.tips_limit.css("display", "none");
					}
					return;
				}
				if (!d.isLogin && b.trim(d.user_name.val()) == "") {
					d.name_tips.css("display", "");
					return;
				}
				if (!d.isLogin && b.trim(d.user_pwd.val()) == "") {
					d.pwd_tips.css("display", "");
					return;
				}
				if (d.error == 0) {
					if (!d.isLogin) {
						d.loginSubject();
					} else {
						d.request();
					}
				}
			});
			if (!this.isLogin) {
				this.user_name.bind("focus",
				function() {
					if (d.name_tips.css("display") != "none") {
						d.name_tips.css("display", "none");
					}
				});
				this.user_pwd.bind("blur",
				function() {
					if (d.pwd_tips.css("display") != "none") {
						d.pwd_tips.css("display", "none");
					}
				});
			}
		},
		setScore: function(e) {
			this.scoreA.each(function() {
				b(this).removeClass("on");
			});
			this.scoreV.val((e + 1) * 2);
			for (var d = 0; d < e + 1; d++) {
				this.scoreA.eq(d).addClass("on");
			}
		},
		checkComment: function() {
			var e = this.Ele_textarea.val();
			if (e == this.tips) {
				return;
			}
			var d = e.replace(/[^\x00-\xFF]/g, "**").length / 2;
			if (d <= this.fontNum) {
				this.limit_cout.html(Math.floor(this.fontNum - d));
				this.error = 0;
				if (this.tips_limit.css("display") == "none") {
					this.tips_limit.css("display", "");
				}
				if (this.tips_over.css("display") != "none") {
					this.tips_over.css("display", "none");
				}
			} else {
				this.over_cout.html(Math.ceil(d - this.fontNum));
				this.error = 1;
				if (this.tips_limit.css("display") != "none") {
					this.tips_limit.css("display", "none");
				}
				if (this.tips_over.css("display") == "none") {
					this.tips_over.css("display", "");
				}
			}
		},
		iFlogin: function() {
			this.Ele_login.show(400);
		},
		loginSubject: function() {
			var d = this;
			b.ajax({
				url: d.login_url,
				type: "post",
				dataType: "json",
				data: {
					email: d.user_name.val(),
					password: d.user_pwd.val()
				},
				success: function(e) {
					if (e.code == 0) {
						d.isLogin = true;
						JX.init.userId = e.msg;
						d.Ele_login.remove();
						d.request();
						location.href = d.pageUrl;
					} else {
						JX.UI.Alert(e.msg);
					}
				}
			});
		},
		request: function() {
			var e = this;
			if (this.sub_url == null || !this.canRequest) {
				return;
			}
			var d = (this.hasScore) ? ({
				rating: this.scoreV.val(),
				content: this.Ele_textarea.val(),
				title: this.Ele_title.val(),
				url: this.Ele_url.val()
			}) : ({
				content: this.Ele_textarea.val(),
				title: this.Ele_title.val(),
				url: this.Ele_url.val()
			});
			this.canRequest = false;
			b.ajax({
				type: "post",
				url: e.sub_url,
				data: d,
				dataType: "json",
				success: function(f) {
					e.loadComment(1);
					if (e.typer == 0) {
						e.setScore(e.starNum / 2 - 1);
					}
					e.limit_cout.html(e.fontNum);
					e.Ele_textarea.val(e.tips);
					e.Ele_textarea.css("color", "#CCC");
					e.canRequest = true;
				}
			});
		},
		loadComment: function(d, e) {
			var f = this;
			if (typeof d == "undefined") {
				d = 1;
			}
			this.Ele_content.empty();
			this.Ele_content.html('<li class="loading" style="height:' + (f.comH + 10) + 'px"></li>');
			b.ajax({
				type: "get",
				url: this.data_url + "?temp=" + new Date().getTime(),
				data: {
					limit: 10,
					pageNo: d
				},
				success: function(g) {
					var h = b.parseJSON(g);
					f.Ele_content.html(h.commentHtml);
					f.Ele_sum.html(h.commentCount);
					f.createPager(d, h.pageCount);
					f.totalNum = h.pageCount;
					f.currentNum = d;
					f.comH = f.Ele_content.height();
					if (e) {
						f.skipTo(f.Ele_content.offset().top);
					}
				}
			});
		},
		createPager: function(d, k) {
			var h = this;
			this.Ele_paging.empty();
			var m = b("<div></div>");
			m.addClass("paging-con");
			this.Ele_paging.append(m);
			var f = parseInt(k);
			if (f <= 1) {
				return;
			}
			var e = b("<a></a>");
			e.html("上一页");
			e.addClass("prev");
			m.append(e);
			if (d == 1) {
				e.addClass("prev-no");
			} else {
				e.bind("click",
				function() {
					h.loadComment(d - 1, true);
				});
			}
			if (f <= this.total) {
				for (var g = 0; g < f; g++) {
					var l = b("<a></a>");
					l.html(g + 1);
					m.append(l);
					if (d == g + 1) {
						l.addClass("on");
					} else {
						h.skipPage(l, g + 1);
					}
				}
			} else {
				h.pageCode(f, m, d);
			}
			var j = b("<a></a>");
			j.html("下一页");
			j.addClass("next");
			m.append(j);
			if (d == f) {
				j.addClass("next-no");
			} else {
				j.bind("click",
				function() {
					h.loadComment(d + 1, true);
				});
			}
		},
		skipPage: function(d, f) {
			var e = this;
			d.bind("click",
			function() {
				e.loadComment(f, true);
			});
		},
		pageCode: function(d, h, j) {
			var f = (this.total % 2 == 0) ? (this.total - 1) : this.total;
			for (var g = 0; g < f; g++) {
				var e = b("<a></a>");
				h.append(e);
				if (j < f - 3) {
					if (g == f - 2) {
						e.addClass("more");
						e.html("…");
					} else {
						if (g == f - 1) {
							this.pageNumber(d, e, j);
						} else {
							this.pageNumber(g + 1, e, j);
						}
					}
				} else {
					if (j > d - 4) {
						if (g == 0) {
							this.pageNumber(1, e, j);
						} else {
							if (g == 1) {
								e.addClass("more");
								e.html("…");
							} else {
								this.pageNumber(g + d - 8, e, j);
							}
						}
					} else {
						if (g == 0) {
							this.pageNumber(1, e, j);
						} else {
							if (g == 1) {
								e.addClass("more");
								e.html("…");
							} else {
								if (j + 4 < d) {
									if (g == f - 2) {
										e.addClass("more");
										e.html("…");
									} else {
										if (g == f - 1) {
											this.pageNumber(d, e, j);
										} else {
											this.pageNumber(j + g - 4, e, j);
										}
									}
								} else {
									this.pageNumber(j + g - 4, e, j);
								}
							}
						}
					}
				}
			}
		},
		pageNumber: function(g, e, d) {
			var f = this;
			e.html(g);
			if (d == g) {
				e.addClass("on");
			} else {
				e.bind("click",
				function() {
					f.loadComment(g, true);
				});
			}
		}
	};
	b.ns("jx.qiantai.comment");
	jx.qiantai.comment = function(d) {
		return new c(d);
	};
})(jQuery); (function(b) {
	b.ns("jx.qiantai.terminal.ps");
	jx.qiantai.terminal.ps = function(n, d, c) {
		var m = d.find("li");
		var j = n.find("div")[0] ? n.find("div") : n;
		var k = m.size();
		if (k <= 1) {
			return;
		}
		var l = n.position().top;
		var p = (window.opera) ? (document.compatMode == "CSS1Compat" ? b("html") : b("body")) : b("html,body");
		if (c) {
			var e = b('<span style="display:none;"></span>');
			var g = b('<span style="display:none;"></span>');
		}
		var f = new Array(k),
		i = 1;
		m.each(function(r) {
			var q = b(this).attr("url");
			h(q, r);
			b(this).bind("click",
			function() {
				i = r + 1;
				o();
			}).bind("mouseover",
			function() {
				b(this).css({
					opacity: 0.8
				});
			}).bind("mouseout",
			function() {
				b(this).css({
					opacity: 1
				});
			});
		});
		function h(q, r) {
			JX.utils.load("img", q,
			function(s) {
				f[r] = s;
			});
		}
		if (typeof c != "undefined" && c) {
			n.css({
				"min-height": "200px"
			});
			e.addClass("shop_prev").attr("title", "上一张").css("top", n.height() / 2 - 20);
			g.addClass("shop_next").attr("title", "下一张").css("top", n.height() / 2 - 20);
			if (JX.uaApple) {
				e.css("display", "block");
				g.css("display", "block");
			}
			n.append(e).append(g);
			if (!JX.uaApple) {
				n.bind("mouseover",
				function() {
					e.css("display", "block");
					g.css("display", "block");
					e.css("top", n.height() / 2 - 20);
					g.css("top", n.height() / 2 - 20);
				}).bind("mouseout",
				function() {
					e.css("display", "none");
					g.css("display", "none");
				});
			}
			e.bind("mouseover",
			function() {
				b(this).addClass("shop_prev_over");
			}).bind("mouseout",
			function() {
				b(this).removeClass("shop_prev_over");
			}).bind("click",
			function() {
				i = (i == 1) ? k: (i - 1);
				o();
			});
			g.bind("mouseover",
			function() {
				b(this).addClass("shop_next_over");
			}).bind("mouseout",
			function() {
				b(this).removeClass("shop_next_over");
			}).bind("click",
			function() {
				i = (i == k) ? 1: (i + 1);
				o();
			});
		} else {
			if (JX.uaApple) {
				n[0].ontouchstart = function(t) {
					var r = n.offset().left;
					var s = r + n.width() / 2;
					var u = n.width() + r;
					var q = a(t).x;
					if (q >= r && q <= s) {
						b(this).removeClass("cursor_next");
						b(this).addClass("cursor_pre");
					}
					if (q > s && q <= u) {
						b(this).removeClass("cursor_pre");
						b(this).addClass("cursor_next");
					}
				};
			} else {
				n.bind("mousemove",
				function(t) {
					var r = n.offset().left;
					var s = r + n.width() / 2;
					var u = n.width() + r;
					var q = a(t).x;
					if (q >= r && q <= s) {
						b(this).removeClass("cursor_next");
						b(this).addClass("cursor_pre");
					}
					if (q > s && q <= u) {
						b(this).removeClass("cursor_pre");
						b(this).addClass("cursor_next");
					}
				});
			}
			n.bind("click",
			function(q) {
				var r = b(this);
				if (r.hasClass("cursor_pre")) {
					i = (i == 1) ? k: (i - 1);
				} else {
					if (r.hasClass("cursor_next")) {
						i = (i == k) ? 1: (i + 1);
					}
				}
				o();
			});
		}
		function o() {
			var s = m.eq(i - 1);
			if (f[i - 1] && f[i - 1].src) {
				j.empty();
				if (c && s.attr("linked") && b.trim(s.attr("linked")) != "#") {
					var q = b('<a href="' + s.attr("linked") + '" target="_blank"></a>');
					j.append(q);
					q.append(f[i - 1]);
				} else {
					j.append(f[i - 1]);
				}
			} else {
				var r = s.attr("url");
				var t = '<img src="' + r + '" width="' + s.attr("width") + '" height="' + s.attr("height") + '"/>';
				if (c && s.attr("linked") && b.trim(s.attr("linked")) != "#") {
					t = '<a href="' + s.attr("linked") + '" target="_blank">' + t + "</a>";
				}
				j.html(t);
			}
			d.find("li.on").removeClass("on");
			m.eq(i - 1).addClass("on");
			if (c) {
				e.css("top", n.height() / 2 - 20);
				g.css("top", n.height() / 2 - 20);
			}
			if (p.scrollTop() <= l) {
				return;
			}
			p.animate({
				scrollTop: l
			},
			200);
		}
	};
	function a(g) {
		if (g.pageX && g.pageY) {
			return {
				x: g.pageX,
				y: g.pageY
			};
		}
		var h = document.body.scrollLeft || document.documentElement.scrollLeft,
		c = document.body.clientLeft || document.documentElement.clientLeft,
		d = document.body.scrollTop || document.documentElement.scrollTop,
		f = document.body.clientTop || document.documentElement.clientTop;
		if (JX.uaApple) {
			return {
				x: g.targetTouches[0].clientX + h - c,
				y: g.targetTouches[0].clientY + d - f
			};
		} else {
			return {
				x: g.clientX + h - c,
				y: g.clientY + d - f
			};
		}
	}
})(jQuery); (function(a) {
	a.ns("jx.qiantai.map");
	jx.qiantai.map = {
		googleMap: function() {
			if (typeof google == "undefined" || typeof google.maps == "undefined") {
				return;
			}
			if (!a("#googleMap")[0]) {
				return;
			}
			var j = new google.maps.Geocoder();
			var d = a("#areaName"),
			k = a("#lat"),
			f = a("#lng");
			var e = jQuery.trim(k.val()),
			h = jQuery.trim(f.val());
			if (e == "" && h == "") {
				var c = jQuery.trim(d.val());
				j.geocode({
					address: c
				},
				function(l, g) {
					if (g == google.maps.GeocoderStatus.OK) {
						var m = l[0].geometry.location;
						e = m.lat();
						h = m.lng();
						i(h, e);
					} else {
						alert("对不起，由于" + g + "不能成功定位！");
					}
				});
			} else {
				i(h, e);
			}
			function i(l, n) {
				var o = new google.maps.LatLng(e, h);
				var m = new google.maps.Map(a("#googleMap").get(0), {
					zoom: 15,
					center: o,
					mapTypeId: google.maps.MapTypeId.ROADMAP
				});
				var g = new google.maps.Marker({
					map: m,
					position: o
				});
			}
		},
		baiduMap: function() {
			if (typeof BMap == "undefined" || typeof BMap.Map == "undefined") {
				return;
			}
			if (!a("#googleMap")[0]) {
				return;
			}
			var i = new BMap.Map("googleMap");
			var j = a("#lat");
			var f = a("#lng");
			var e = jQuery.trim(j.val()),
			h = jQuery.trim(f.val());
			var c = new BMap.Point(h, e);
			i.centerAndZoom(c, 16);
			i.addControl(new BMap.NavigationControl());
			i.enableScrollWheelZoom();
			i.enableKeyboard();
			var d = new BMap.Marker(c);
			i.addOverlay(d);
		}
	};
	var b = function(d) {
		var c = document.createElement("script");
		c.src = d;
		document.getElementsByTagName("head")[0].appendChild(c);
	};
	a(document).ready(function() {
		if (!a("#googleMap")[0]) {
			return;
		}
		b("http://api.map.baidu.com/api?v=1.3&callback=jx.qiantai.map.baiduMap");
	});
})(jQuery); (function(c, b) {
	c.ns("jx.qiantai.wish");
	var a = function(d) {
		c.extend(this, {
			defaultClass: "bt_wish",
			activeClass: "bt_wish_on",
			onFinish: function() {}
		},
		d || {});
		this._init();
	};
	c.extend(a.prototype, {
		_init: function() {
			this._addEvent();
		},
		_addEvent: function() {
			var d = this;
			c(document).delegate("." + this.defaultClass, "click",
			function() {
				var e = c(this);
				if (! (e.hasClass(d.activeClass))) {
					c.POST(JX.ROOT.DOMAIN + "favorite/wish?targetId=" + e.attr("gid"), {},
					function(f) {
						if (f.code == 0) {
							e.addClass(d.activeClass);
							d.onFinish(f.wishCount, true, f.gid);
						} else {
							if (f.code == 403) {
								location.href = JX.ROOT.DOMAIN + "user/login?originUrl=" + encodeURIComponent(location.href);
							} else {
								JX.UI.Alert("系统错误");
							}
						}
					},
					"json");
				} else {
					c.POST(JX.ROOT.DOMAIN + "favorite/wish/cancel?targetId=" + e.attr("gid"), {},
					function(f) {
						if (f.code == 0) {
							e.removeClass(d.activeClass);
							d.onFinish(f.wishCount, false, f.gid);
						} else {
							if (f.code == 403) {
								location.href = JX.ROOT.DOMAIN + "user/login?originUrl=" + encodeURIComponent(location.href);
							} else {
								JX.UI.Alert("系统错误");
							}
						}
					},
					"json");
				}
				return false;
			});
		},
		markWishedProducts: function() {
			var d = this;
			c.GET(JX.ROOT.DOMAIN + "favorite/gids?rand=" + c.rand(), {},
			function(e) {
				if (e.code == 0) {
					c.each(e.gids,
					function(g, f) {
						var h = c("#" + f + "_wish");
						h.addClass(d.activeClass);
					});
				} else {
					if (e.code == 403) {}
				}
			},
			"json");
		}
	});
	jx.qiantai.wish = function(d) {
		return new a(d);
	};
})(jQuery, window); (function(c, b) {
	c.ns("jx.qiantai.like");
	var a = function(d) {
		c.extend(this, {
			defaultClass: "bt_like",
			activeClass: "bt_like_on",
			onFinish: function() {}
		},
		d || {});
		this._init();
	};
	c.extend(a.prototype, {
		_init: function() {
			this._addEvent();
		},
		_addEvent: function() {
			var d = this;
			c(document).delegate("." + this.defaultClass, "click",
			function() {
				var e = c(this);
				if (! (e.hasClass(d.activeClass))) {
					c.POST(JX.ROOT.DOMAIN + "fond?targetId=" + e.attr("gid"), {},
					function(f) {
						if (f.code == 0) {
							e.addClass(d.activeClass);
							d.onFinish(f.likeCount, true, f.gid);
						} else {
							if (f.code == 403) {
								location.href = JX.ROOT.DOMAIN + "user/login?originUrl=" + encodeURIComponent(location.href);
							} else {
								JX.UI.Alert("系统错误");
							}
						}
					},
					"json");
				} else {
					c.POST(JX.ROOT.DOMAIN + "fond/cancel?targetId=" + e.attr("gid"), {},
					function(f) {
						if (f.code == 0) {
							e.removeClass(d.activeClass);
							d.onFinish(f.likeCount, false, f.gid);
						} else {
							if (f.code == 403) {
								location.href = JX.ROOT.DOMAIN + "user/login?originUrl=" + encodeURIComponent(location.href);
							} else {
								JX.UI.Alert("系统错误");
							}
						}
					},
					"json");
				}
				return false;
			});
		},
		markLikedProducts: function() {
			var d = this;
			c.GET(JX.ROOT.DOMAIN + "fond/gids?rand=" + c.rand(), {},
			function(e) {
				if (e.code == 0) {
					c.each(e.gids,
					function(h, f) {
						var g = c("#" + f + "_like");
						g.addClass(d.activeClass);
					});
				} else {
					if (e.code == 403) {}
				}
			},
			"json");
		}
	});
	jx.qiantai.like = function(d) {
		return new a(d);
	};
})(jQuery, window); (function($) {
	var like = jx.qiantai.like({
		defaultClass: "btn-xh_gray",
		activeClass: "btn-xh",
		onFinish: function() {}
	});
	var wish = jx.qiantai.wish({
		defaultClass: "btn-wish_gray",
		activeClass: "btn-wish",
		onFinish: function() {}
	});
	$(function() {
		if (typeof terHotelId == "undefined") {
			return;
		}
		var url = "http://www.jiexi.com/jiudian/" + terHotelId + "/dangqi";
		$.GET(url, {},
		function(data) {
			if ($("#terDaysCal")[0] && data) {
				var terDangData = eval(data);
				var con = $("#terDaysCal");
				var prev = $("#terDaysPrev");
				var next = $("#terDaysNext");
				var page = 0,
				maxPage = 7;
				var data = terDangData;
				var id = terHotelGid;
				prev.bind("click",
				function() {
					var obj = $(this);
					if (obj.hasClass("tdt-prev-no") && page == 0) {
						return;
					}
					if (next.hasClass("tdt-next-no")) {
						next.removeClass("tdt-next-no");
					}
					page -= 1;
					if (page <= 0) {
						obj.addClass("tdt-prev-no");
						page = 0;
					}
					loadDang(con, getArr(page, data), id);
				});
				next.bind("click",
				function() {
					var obj = $(this);
					if (obj.hasClass("tdt-next-no") && page == maxPage) {
						return;
					}
					if (prev.hasClass("tdt-prev-no")) {
						prev.removeClass("tdt-prev-no");
					}
					page += 1;
					if (page >= maxPage) {
						obj.addClass("tdt-next-no");
						page = maxPage;
					}
					loadDang(con, getArr(page, data), id);
				});
				loadDang(con, getArr(0, data), id);
			}
			function getArr(page, arr) {
				var a = [];
				var len = Math.min(page * 3 + 3, arr.length);
				for (var i = page * 3; i < len; i++) {
					a.push(arr[i]);
				}
				return a;
			}
			function loadDang(dangCon, data, id) {
				dangCon.empty();
				for (var i = 0, len = data.length; i < len; i++) {
					var m = parseInt(data[i].month, 10);
					m = (m <= 9) ? ("0" + m) : m;
					var jud = JX.UI.Datepicker({
						contrainer: dangCon,
						model: 3,
						ymd: data[i].year + "-" + m + "-01",
						callback: function(oo) {
							_this = this;
							oo.find("td a").each(function() {
								var obj = $(this);
								if (jQ.inArray(parseInt(obj.html()), data[i].days) != -1 && obj.attr("month") == data[i].month) {
									obj.addClass("no");
								}
								if (!obj.hasClass("no") && !obj.parent().hasClass("jdp-no")) {
									var mm = parseInt(obj.attr("month"));
									mm = (mm <= 9) ? ("0" + mm) : mm;
									var dd = parseInt(obj.html());
									dd = (dd <= 9) ? ("0" + dd) : dd;
									var d = obj.attr("year") + "-" + mm + "-" + dd;
									obj.attr({
										target: "blank",
										href: "/booking/creating?productId=" + id + "&targetDate=" + d
									});
									obj.bind("mouseover",
									function() {
										$(this).addClass("over");
									}).bind("mouseout",
									function() {
										$(this).removeClass("over");
									});
								}
							});
						}
					});
					jud.onCreate();
					if (i == len - 1 && i == 2) {
						jud.panel.addClass("jx-datepicker-end");
					}
				}
			}
		});
	});
	$(function() {
		var p = $(".terminal-boxer .ter-toper-L");
		var h = p.find("h1");
		var yd = $(".terminal-boxer .ter-toper-R").width();
		if (h[0]) {
			var value = h.html();
			var len = value.replace(/[^\x00-\xFF]/g, "**").length;
			if (len >= 32 && len <= 40) {
				h.css({
					"font-size": "20px"
				});
			} else {
				if (len > 40 && len <= 52) {
					h.css({
						"font-size": "16px"
					});
				} else {
					if (len > 52) {
						h.css({
							"font-size": "16px",
							width: "400px"
						});
					}
				}
			}
			if (yd < 210) {
				p.css({
					width: "490px"
				});
				if (len > 50 && len <= 58) {
					h.css({
						"font-size": "20px"
					});
				} else {
					if (len > 58) {
						h.css({
							"font-size": "16px"
						});
					}
				}
			}
		}
	});
	$(function() {
		var id = "terTab";
		var terTab = $("#" + id);
		if (!terTab[0]) {
			return false;
		}
		var tabcs = $("#terBoxer ." + id + "-rel");
		terTab.find("a").bind("click",
		function() {
			var obj = $(this);
			if (obj.hasClass("on")) {
				return false;
			}
			terTab.find("a.on").removeClass("on");
			obj.addClass("on");
			tabcs.each(function() {
				if ($(this).css("display") != "none") {
					$(this).hide();
				}
			});
			if (obj.attr("id") && $("#" + obj.attr("id") + "_boxer")[0]) {
				$("#" + obj.attr("id") + "_boxer").show();
			}
			return false;
		});
		function toTab(id) {
			terTab.find("a.on").removeClass("on");
			var obj = $("#" + id);
			obj.addClass("on");
			tabcs.each(function() {
				if ($(this).css("display") != "none") {
					$(this).hide();
				}
			});
			if ($("#" + id + "_boxer")[0]) {
				$("#" + id + "_boxer").show();
			}
		}
		$("#wishModule").bind("click",
		function() {
			if ($("#terLike")[0]) {
				toTab("terLike");
				toScroll($("#terTab").position().top);
			}
			return false;
		});
		$("#commentModule").bind("click",
		function() {
			if ($("#terComment")[0]) {
				toTab("terComment");
				toScroll($("#terTab").position().top);
			}
			return false;
		});
		$("#productModule").bind("click",
		function() {
			if ($("#terProduct")[0]) {
				toTab("terProduct");
				toScroll($("#terTab").position().top);
			}
			return false;
		});
		var url = location.href;
		if (url.indexOf("#") != -1) {
			var name = url.split("#")[1];
			if ($("#ter" + name)[0]) {
				toTab("ter" + name);
				toScroll($("#terTab").position().top);
			}
		}
		function toScroll(h) {
			var ch = document.documentElement.clientHeight || document.body.clientHeight;
			var sh = document.documentElement.scrollHeight || document.body.scrollHeight;
			if (ch < sh) {
				var b = (window.opera) ? (document.compatMode == "CSS1Compat" ? $("html") : $("body")) : $("html,body");
				b.animate({
					scrollTop: h
				},
				200);
			}
		}
	});
})(jQuery); (function(c) {
	c.ns("jx.qiantai.share");
	var a = {
		topic: "",
		title: "",
		desc: "",
		url: "",
		pic: "",
		num: 6,
		hasTitle: true,
		marker: "分享到：",
		callback: function() {}
	};
	var b = function(g, e) {
		this.contrainer = g;
		var f = c.extend({},
		a, e);
		for (var d in f) {
			this[d] = f[d];
		}
		this.title = (this.title == "") ? document.title: this.title;
		this.title = this.title.replace("%", "％");
		this.url = (this.url == "") ? location.href: this.url;
		this.url = (this.url.indexOf("?") != -1) ? (this.url + "&sharefrom=") : (this.url + "?sharefrom=");
		var h = this.hasTitle ? encodeURIComponent("#" + this.topic + "#" + this.title + "-" + this.desc + "@皆喜结婚网 #结婚# #皆喜网#") : encodeURIComponent("#" + this.topic + "#" + this.desc);
		this.setting = [{
			type: "renren",
			name: "分享到人人网",
			params: {
				api_key: "25882b080b364e3b9495712399f0f118",
				resourceUrl: encodeURIComponent(this.url + "renren"),
				title: encodeURIComponent(this.title),
				pic: this.pic,
				description: encodeURIComponent("分享了”" + this.topic + "“" + this.desc + "@皆喜公共主页")
			},
			skip: "http://widget.renren.com/dialog/share?"
		},
		{
			type: "sinawb",
			params: {
				url: encodeURIComponent(this.url + "sinawb"),
				appkey: "2254251972",
				title: h,
				pic: this.pic
			},
			name: "分享到新浪微博",
			skip: "http://v.t.sina.com.cn/share/share.php?"
		},
		{
			type: "qqkj",
			name: "分享到QQ空间",
			skip: "http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?",
			params: {
				url: encodeURIComponent(this.url + "qqkj"),
				desc: "",
				summary: encodeURIComponent(this.desc),
				title: encodeURIComponent(this.title),
				site: "皆喜网",
				pics: encodeURIComponent(this.pic)
			}
		},
		{
			type: "douban",
			name: "分享到豆瓣网",
			skip: "http://www.douban.com/recommend/?",
			params: {
				url: encodeURIComponent(this.url + "douban"),
				title: encodeURIComponent(this.desc)
			}
		}];
		this.init();
	};
	b.prototype = {
		init: function() {
			var d = Math.min(this.num, this.setting.length);
			var f = "<strong>" + this.marker + '</strong><div class="jx-share-con">';
			for (var e = 0; e < d; e++) {
				f += '<a class="jx-share-' + this.setting[e].type + '" title="' + this.setting[e].name + '" href="javascript:void(0);"></a>';
			}
			f += "</div>";
			this.contrainer.html(f);
			this.addEvent();
		},
		addEvent: function() {
			var e = this;
			var d = this.contrainer.find("a");
			d.each(function(f) {
				e.skipTo(c(this), f);
			});
		},
		skipTo: function(d, f) {
			var e = this;
			d.bind("click",
			function() {
				var i = e.setting[f].skip;
				var g = [];
				for (var h in e.setting[f].params) {
					g.push(h + "=" + e.setting[f].params[h]);
				}
				e.callback();
				window.open(i + g.join("&"));
				return false;
			});
		},
		getUrl: function(j) {
			var g = 0;
			for (var h = 0, e = this.setting.length; h < e; h++) {
				if (typeof j != "undefined" && j == this.setting[h].type) {
					g = h;
				}
			}
			var d = [];
			for (var f in this.setting[g].params) {
				d.push(f + "=" + this.setting[g].params[f]);
			}
			return this.setting[g].skip + d.join("&");
		}
	};
	jx.qiantai.share = function(e, d) {
		return new b(e, d);
	};
})(jQuery); (function(c) {
	c.ns("jx.qiantai.ad");
	var b = function(e) {
		var f = c.extend({},
		a, e);
		for (var d in f) {
			this[d] = f[d];
		}
		this.length = this.data.length;
		this.maker = 1;
		this.toggler = true;
		this.timer = null;
		this.blocks = [];
		this.oldMaker = this.maker;
	};
	b.prototype = {
		init: function() {
			this.onCreate();
		},
		onCreate: function() {
			var h = this;
			this.panel = c("<div></div>");
			this.panel.css({
				position: "relative",
				background: "#FFF",
				width: this.width,
				height: this.height,
				overflow: "hidden"
			});
			this.scrolling = c("<div></div>");
			this.scrolling.css({
				width: this.width * (this.length + 1),
				position: "absolute",
				top: 0,
				left: 0
			});
			this.signer = c("<div></div>");
			this.signer.css({
				position: "absolute",
				right: 1,
				bottom: 6
			});
			if (this.length > 1 && this.manner == 0) {
				this.data.push(this.data[0]);
			}
			for (var e = 0; e < this.data.length; e++) {
				var g = c("<div></div>");
				if (this.manner == 1) {
					g.css({
						position: "absolute",
						top: 0,
						left: 0,
						display: "none",
						opacity: 0,
						width: this.width,
						height: this.height,
						overflow: "hidden"
					});
				} else {
					g.css({
						"float": "left",
						width: this.width,
						height: this.height,
						overflow: "hidden"
					});
				}
				if (this.data[e].type == "img") {
					var d = c("<a></a>");
					d.attr({
						href: this.data[e].link,
						target: "_blank"
					});
					d.html('<img src="' + this.data[e].src + '" />');
					g.append(d);
					d[0].onclick = (function(j) {
						return function() {
							h.coutAd(h.data[j].adId);
						};
					})(e);
				} else {
					if (this.data[e].type == "html") {
						g.html(this.data[e].html);
					}
				}
				if (e < this.length) {
					var f = c("<span></span>");
					f.css({
						"float": "left",
						"margin-right": 5,
						width: 15,
						height: 15,
						"text-align": "center",
						color: "#D080A9",
						"line-height": "15px",
						"font-weight": "bold",
						border: "1px solid #DBDBDB",
						background: "#FFF",
						cursor: "pointer"
					});
					if (e == 0) {
						f.addClass("on");
						f.css({
							color: "#BEBEBF"
						});
						if (this.manner == 1) {
							g.css({
								display: "block",
								opacity: 1
							});
						}
					}
					f.html(e + 1);
					this.signer.append(f);
				}
				this.scrolling.append(g);
				if (this.manner == 1) {
					this.blocks.push(g);
				}
			}
			this.panel.append(this.scrolling);
			if (this.length > 1) {
				this.panel.append(this.signer);
			}
			this.contrainer.append(this.panel);
			if (this.length > 1) {
				this.addEvent();
			}
		},
		coutAd: function(d) {
			if (this.coutUrl != null) {
				c.POST(this.coutUrl + d + "/click", {},
				function() {});
			}
		},
		tabs: function(e) {
			var d = this.signer.find("span");
			d.each(function() {
				var f = c(this);
				if (f.hasClass("on")) {
					f.removeClass("on");
					f.css("color", "#D080A9");
				}
			});
			d.eq(e).addClass("on");
			d.eq(e).css("color", "#BEBEBF");
		},
		addEvent: function() {
			var d = this;
			if (this.player) {
				this.switchItem();
			}
			this.scrolling.bind("mouseover",
			function() {
				d.toggler = false;
			}).bind("mouseout",
			function() {
				clearTimeout(d.timer);
				d.toggler = true;
				if (d.player) {
					d.switchItem();
				}
			});
			this.signer.delegate("span", "click",
			function() {
				var e = parseInt(c(this).html());
				if (d.maker == e) {
					return;
				}
				d.oldMaker = d.maker;
				d.maker = e;
				d.tabs(d.maker - 1);
				d.fx(e);
			});
		},
		switchItem: function() {
			var d = this;
			this.timer = setTimeout(function() {
				if (d.toggler) {
					if (d.manner == 1) {
						var f = d.maker;
						var e = (d.maker == d.length) ? 1: (d.maker + 1);
						d.blocks[f - 1].stop();
						d.blocks[e - 1].stop();
						d.blocks[f - 1].animate({
							opacity: 0
						},
						"400", "swing",
						function() {
							d.blocks[f - 1].css("display", "none");
						});
						d.blocks[e - 1].css("display", "block");
						d.blocks[e - 1].animate({
							opacity: 1
						},
						"400", "swing",
						function() {
							d.maker = e;
							d.tabs(d.maker - 1);
							clearTimeout(d.timer);
							if (d.player) {
								d.switchItem();
							}
						});
					} else {
						d.scrolling.stop();
						d.scrolling.animate({
							left: -d.width * d.maker
						},
						"400", "swing",
						function() {
							if (d.maker == d.length) {
								d.maker = 1;
								d.scrolling.css("left", 0);
							} else {
								d.maker += 1;
							}
							d.tabs(d.maker - 1);
							clearTimeout(d.timer);
							if (d.player) {
								d.switchItem();
							}
						});
					}
				}
			},
			this.gaper);
		},
		fx: function(d) {
			var g = this;
			if (this.manner == 1) {
				var f = g.oldMaker;
				var e = d;
				g.blocks[f - 1].stop();
				g.blocks[e - 1].stop();
				g.blocks[f - 1].animate({
					opacity: 0
				},
				"400", "swing",
				function() {
					g.blocks[f - 1].css("display", "none");
				});
				g.blocks[e - 1].css("display", "block");
				g.blocks[e - 1].animate({
					opacity: 1
				},
				"400", "swing");
			} else {
				this.scrolling.stop();
				this.scrolling.animate({
					left: -this.width * (d - 1)
				},
				"400", "swing");
			}
		}
	};
	jx.qiantai.ad = function(d) {
		return new b(d);
	};
	var a = {
		contrainer: null,
		coutUrl: null,
		data: null,
		width: 200,
		height: 0,
		pos: 0,
		player: true,
		typer: 0,
		gaper: 5000,
		manner: 0
	};
	c(function() {
		if (typeof waterfall_type != "undefined" && waterfall_type == "all") {
			var g = {
				type: "home",
				gaper: 8000,
				data: [{
					src: "http://jximg.com/image/jiexi/77/relian980-355.jpg",
					height: 290,
					link: "http://www.jiexi.com/event/relian?from=bigad"
				}]
			};
			var i = true;
			var f = (JX.utils.getCookie("eventrelian") == 1) ? false: true;
			var l = g.gaper ? g.gaper: 8000;
			var j = new Date().getTime(),
			d = new Date("2012/7/7 00:00").getTime();
			if (i && g.type == "home" && g.data && g.data.length > 0 && c("#jxAdIndexTop")[0] && f && j >= d) {
				g = g.data[0];
				JX.utils.load("img", g.src,
				function() {
					var p = c("#jxAdIndexTop");
					if (JX.init.userId && JX.init.userId != "-1") {
						p.css({
							background: "url(http://jximg.com/image/jiexi/77/ad_bg.jpg) repeat-x"
						});
					} else {
						p.css({
							background: "url(http://jximg.com/image/jiexi/77/ad_bg2.jpg) repeat-x"
						});
					}
					var o = p.height();
					var n = c("<a></a>");
					n.css({
						display: "block",
						background: "url(" + g.src + ") no-repeat center bottom",
						width: "100%",
						height: g.height + o,
						position: "relative"
					});
					n.attr("target", "_blank");
					n.attr("href", g.link);
					p.append(n);
					var m = c("<span></span>");
					m.css({
						position: "absolute",
						right: 10,
						top: 20,
						width: 25,
						height: 25,
						background: "url(http://jximg.com/image/jiexi/77/ad_closed.png) no-repeat -1px 0",
						display: "block",
						cursor: "pointer",
						zIndex: 49
					});
					n.append(m);
					m.bind("click",
					function() {
						p.animate({
							height: o
						},
						"slow", "swing",
						function() {
							n.remove();
							p.css({
								background: "none"
							});
						});
						return false;
					});
					p.animate({
						height: g.height + o
					},
					"slow", "swing",
					function() {
						setTimeout(function() {
							p.animate({
								height: o
							},
							"slow", "swing",
							function() {
								n.remove();
								p.css({
									background: "none"
								});
							});
						},
						l);
					});
					JX.utils.setCookie("eventrelian", 1, 20, "/", "jiexi.com");
				});
			}
		}
		if (c("#waterfall")[0]) {
			c("#waterfall").delegate(".index_water-product a", "click",
			function() {
				var m = c(this);
				if (m.attr("adid")) {
					c.POST("/ad/" + m.attr("adid") + "/click", {},
					function() {});
				}
			});
		}
		function e(n) {
			var m = (navigator.userAgent.indexOf("Windows") != -1) ? 1: 0;
			c.GET("/about/qqinfo", {
				rand: c.rand(),
				os: m
			},
			function(o) {
				if (c("#emptyCaseBox")[0]) {
					c("#emptyCaseBox").html("<h2>皆喜预约通道</h2>" + o);
				}
				n(o);
			});
		}
		function k(m) {
			var q = [];
			var o = true;
			var p = {
				type: "html",
				html: '<div class="index_water-wrap clearfix"><div class="index_bar-empty"><h2 style="padding-bottom:6px;">皆喜预约通道</h2>' + m + '</div></div><div class="waterfall-shadow-header"></div><div class="waterfall-shadow-footer"></div>'
			};
			if (typeof jxAdentryPath != "undefined" && typeof jxAdPageType != "undefined") {
				var n = "/ad?entryPath=" + jxAdentryPath + "&adType=" + jxAdPageType;
				c.GET(n, {
					rand: c.rand()
				},
				function(u) {
					var v = c.parseJSON(u);
					if (v && v.code == 0 && v.data.length > 0) {
						o = false;
						for (var t = 0, s = v.data.length; t < s; t++) {
							var r = {
								adId: v.data[t].adId,
								gid: v.data[t].gid,
								src: v.data[t].srcUrl,
								link: v.data[t].link,
								type: "img"
							};
							q.push(r);
						}
					}
					if (typeof m != "undefined" && !c("#emptyCaseBox")[0]) {
						q.push(p);
					}
					h(q, o);
				});
			} else {
				if (typeof m != "undefined" && !c("#emptyCaseBox")[0]) {
					q.push(p);
				}
				h(q, o);
			}
		}
		function h(p, n) {
			if (p.length <= 0) {
				return;
			}
			if (typeof waterfall_type != "undefined") {
				var q = c("<div><div>");
				q.addClass("index_water-product");
				var m = c("<div></div>");
				m.addClass("waterfall-cube");
				q.append(m);
				if (n) {
					m.css({
						width: 222,
						height: 80
					});
					m.html(p[0].html);
					jx.qiantai.index.waterfall.insertBefore(q, "0_0");
				} else {
					m.css({
						width: 222,
						height: 280
					});
					jx.qiantai.index.waterfall.insertBefore(q, "0_0");
					jx.qiantai.ad({
						contrainer: m,
						width: 222,
						height: 280,
						data: p,
						gaper: 5000,
						coutUrl: "/ad/"
					}).init();
				}
			} else {
				if (c(".terminal-right")[0]) {
					var o = c(".terminal-right");
					var q = c("<div></div>");
					q.css({
						border: "1px solid #DDD"
					});
					o.append(q);
					jx.qiantai.ad({
						contrainer: q,
						width: 222,
						height: 280,
						data: p,
						gaper: 5000,
						coutUrl: "/ad/"
					}).init();
				}
			}
		}
		if ((typeof waterfall_type != "undefined" && waterfall_type == "hotel") || c("#emptyCaseBox")[0]) {
			e(function(m) {
				k(m);
			});
		} else {
			k();
		}
	});
})(jQuery);